<?php
    include_once($_SERVER['DOCUMENT_ROOT'].'/LLKH/Models/NguoiDung.php');
    class QuanLyKhoaHoc extends NguoiDung{
        private $QL_Ten;
        private $QL_Ma;
        private $QL_email;
        public function setMaQuanLy($QL_Ma){
            $this->QL_Ma = $QL_Ma;
        }
        public function getMaQuanLy(){
            return $this->QL_Ma;
        } 
        public function setTenQuanLy($QL_Ten){
            $this->QL_Ten = $QL_Ten;
        }
        public function getTenQuanLy(){
            return $this->QL_Ten;
        }               
        public function setEmailQL($email){
            $this->QL_email = $QL_email;
        }
        public function getEmailQL(){
            return $this->QL_email;
        }      
        public function getMaxMSQL(){
            $query = "SELECT MAX(ND_ID)FROM quanlykhoahoc";
            $this->setQuery($query);
            return $this->fetchAll();
        }
        public function themQuanLy(){
            $query = "insert into QuanLyKhoaHoc(ND_ID,QL_HoTen,QL_Email) 
            values ('".$this->getMaQuanLy()."','".$this->getTenQuanLy()."','".$this->getEmailQL()."')";
            $this->setQuery($query);
            //echo $this->getQuery();
            return $this->executeQuery();
        }
        public function suaQuanLy(){
            $query = "update QuanLyKhoaHoc set QL_HoTen='".$this->getTenQuanLy()."',QL_Email='".$this->getEmailQL()."' where ND_ID='".$this->getMaSo()."'";
            $this->setQuery($query);
            return $this->executeQuery();
        }
        public function xoaQuanLy(){
            $this->setQuery("delete from QuanLyKhoaHoc where  ND_ID='".$this->getMaSo()."'");
            return $this->executeQuery();
        }
        public function thongtinQuanLy(){
            $query = "select ND_ID,QL_HoTen,QL_Email from QuanLyKhoaHoc";
            $query .= " where  ND_ID='".$this->getMaQuanLy()."'";
            $this->setQuery($query);
            return $this->fetchAll();
        }
        public function dsQuanLy(){
            $this->setQuery("select ND_ID,QL_HOTEN,QL_EMAIL from QuanLyKhoaHoc");
            return $this->fetchAll();
        }
    }
?>